package com.changgou.listener;

import javax.annotation.Resource;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import com.changgou.config.RabbitmqConfig;
import com.changgou.service.PageService;

/**
 * 数据变更mq监听，动态生成静态页面
 * 
 * @author gaofeng
 * @date 2025年04月28日 19:56
 */
@Component
public class AuditListener {
    @Resource
    private PageService pageService;

    @RabbitListener(containerFactory = "simpleRabbitListenerContainerFactory", queues = RabbitmqConfig.QUEUE_NAME)
    public void onSale(Long spuId) {
        pageService.createPageHtml(spuId);
    }
}
